/**
 * @file NetCtrl.c
 * @Synopsis
 * @author JzeTech
 * @version 0.1 beta
 * @date 1009-08-18
 */
#ifndef VIDEO_PARA_H
#define VIDEO_PARA_H

#include "XmlParser.h"
#include "../av/avStruct.h"
#include "net.h"
#include "netCommon.h"


/**
 * @brief
 *
 * @param root
 * @param mhandle
 */
void GetFrameStruct(mxml_node_t* root, FrameStruct *frameStruct);

/**
 * @brief
 *
 * @param root
 * @param mhandle
 */
void GetQuantLevel(mxml_node_t* root, char* quantLevel);

/**
 * @brief
 *
 * @param root
 * @param mhandle
 */
void GetMaxBPS(mxml_node_t* root, char* maxBPS);

/**
 * @brief
 *
 * @param root
 * @param mhandle
 */
void GetPicFormat(mxml_node_t* root, PicFormat* picFormat);

/**
 * @brief
 *
 * @param root
 * @param mhandle
 */
void GetVideoAttrs(mxml_node_t* root, VideoPara* videoPara);


/**
 * @brief
 *
 * @param root
 * @param mhandle
 */
void GetHideZone(mxml_node_t* root, HideZone* hideZone);

/**
 * @brief
 *
 * @param root
 * @param mhandle
 */
void GetRectanglePara(mxml_node_t* node, struct Rectangle* rect, int num);
void SetRectanglePara(mxml_node_t* node, struct Rectangle* rect);

/**
 * @brief
 *
 * @param root
 * @param mhandle
 */
void GetTimeAndLogo(mxml_node_t* root);

/**
 * @brief
 *
 * @param root
 * @param mhandle
 */
void GetPicDetect(mxml_node_t* root, PicDetect* picDetect);

/**
 * @brief Get video Para
 *
 * @param fp
 * @param root
 * @param mhandle
 */
void SetMainVideoParas(FILE* fp, Video_Param* videoParam, int fd);

/* --------------------------------------------------------------------------*/
/**
 * @Synopsis
 *
 * @Param fp
 * @Param root
 * @Param mhandle
 */
/* ----------------------------------------------------------------------------*/
void SetVideoStreamType(FILE* fp,mxml_node_t* root, MegaEyesHandle* mhandle);

/* --------------------------------------------------------------------------*/
/**
 * @Synopsis
 *
 * @Param fp
 * @Param root
 * @Param mhandle
 */
/* ----------------------------------------------------------------------------*/
void SetVideoFrameStruct(FILE* fp, mxml_node_t* root, FrameStruct* frameStruct);

/* --------------------------------------------------------------------------*/
/**
 * @Synopsis
 *
 * @Param fp
 * @Param root
 * @Param mhandle
 */
/* ----------------------------------------------------------------------------*/
//void GetVideoQuantLevel(FILE* fp, mxml_node_t* root, int* quantLevel);

/* --------------------------------------------------------------------------*/
/**
 * @Synopsis
 *
 * @Param fp
 * @Param root
 * @Param mhandle
 */
/* ----------------------------------------------------------------------------*/
//void GetVideoMaxBPS(FILE* fp, mxml_node_t* root, int* maxBPS);

/* --------------------------------------------------------------------------*/
/**
 * @Synopsis
 *
 * @Param fp
 * @Param root
 * @Param mhandle
 */
/* ----------------------------------------------------------------------------*/
//void GetVideoPicFormat(FILE* fp, mxml_node_t* root, PicFormat* picFormat);

/* --------------------------------------------------------------------------*/
/**
 * @Synopsis
 *
 * @Param fp
 * @Param root
 * @Param mhandle
 */
/* ----------------------------------------------------------------------------*/
//void GetVideoParameter(FILE* fp, mxml_node_t* root, VideoPara* videoPara);

/* --------------------------------------------------------------------------*/
/**
 * @Synopsis
 */
/* ----------------------------------------------------------------------------*/
void SetVideoMaxBPSPara(FILE* fp, int* maxBPS, int fd);

/**
 * @brief
 *
 * @param fp
 * @param root
 * @param mhandle
 */

void SetVideoPicFormatPara(FILE* fp, PicFormat* picFormat, int fd);

/**
 * @brief
 *
 * @param fp
 * @param root
 * @param mhandle
 */

void SetVideoHideZonePara(FILE* fp, HideZone* hideZone, int fd);

/**
 * @brief
 *
 * @param fp
 * @param root
 * @param mhandle
 */

void SetVideoTimeLogoPara(FILE* fp, TimeLogo* timeLogo, int fd);


void SetVideoDetectingPara(FILE* fp,struct Picture_Detect* picDetect, int fd);

//void GetVideoRectPara(FILE* fp, mxml_node_t* root, struct Rectangle* rectangle);

void SetVideoQuantLevelPara(FILE* fp, int* quantLevel, int fd);

void SendVideoParaGettingData(const char *fname, int fd, mxml_node_t *node);

void SetVideoAttrs(FILE* fp, struct Video_Para* videoPara, int fd);

void SetCodecPara(int fd, char *buff, int blen, int code);
void SendCodecPara(int fd,char *buff, int blen,  int code);
void SendVideoParaFrameStruct(int fd);
void SendVideoParaRecordLevel(int fd);
void SendVideoParaMaxBPS(int fd);
void SendVideoParaPicFormat(int fd);
void SendVideoParaHideZone(int fd);
void SendVideoParaTimeLogo(int fd);
void SendVideoParaVPara(int fd);
void SendVideoParaPicDetect(int fd);

void SetCapturePara(int fd, char *buff, int blen, int code);
void SendCapturePara(int fd,char *buff, int blen,  int code);

#endif

